Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

61 Lisää plugin asetuksiin lambda-kutsujen osoite #67

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

Mtk112
Copy link
Contributor

@Mtk112 Mtk112 commented Nov 11, 2024

Lisätty Asetukset nappi, joka avaa lomakkeen jolla lambdan osoite voidaan asettaa.
Oletus arvoina localhost:8083
Tallenetaan aktiivisen kaavan id projektimuutujaan.

@Mtk112 Mtk112 added the enhancement New feature or request label Nov 11, 2024
@Mtk112 Mtk112 self-assigned this Nov 11, 2024
@Mtk112 Mtk112 linked an issue Nov 12, 2024 that may be closed by this pull request
@Mtk112 Mtk112 marked this pull request as ready for review November 12, 2024 08:32
Copy link
Contributor

@LKajan LKajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aktiivisen kaavan muuttujan vaihtamisen voisi siirtää metodiin, joka asettaa myös sen filtteröinnin.

text="Asetukset",
triggered_callback=self.open_settings,
add_to_menu=True,
add_to_toolbar=True,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Riittää varmaan, että asetukset löytyvät plugin-menusta, ei tarvi olla toolbarissa.

Suggested change
add_to_toolbar=True,
add_to_toolbar=False,

@@ -162,6 +164,24 @@ def initGui(self) -> None: # noqa N802
add_to_toolbar=True,
)

self.validate_plan_action = self.add_action(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oliko tarkoitus, että tää pelkästään validoi vai vie kaavan Ryhtiin? Muuttujan nimeäminen sen mukaisesti.

Copy link
Contributor Author

@Mtk112 Mtk112 Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Käytin vähän harhaanjohtavia nimiä, tuosta olisi tarkoitus lopulta tulla Ryhtiin vienti. Korjaan tämän.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poistin tuon keskeneräisen napin tästä pullrequestista. Se lisätään uudelleen myöhemmässä vaiheessa.

@@ -162,6 +164,24 @@ def initGui(self) -> None: # noqa N802
add_to_toolbar=True,
)

self.validate_plan_action = self.add_action(
"",
text="Vahvista kaava",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mitä tarkoitat termillä "vahvista kaava" viekö nappi kaavan Ryhtiin vai validoiko vaan, kuten muuttujan ja trigger-funktion nimi viittaa?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Korjaan nimet järkvämmiksi. Eli tämä nappi veisi lopulta kaavan Ryhtiin.

@@ -64,6 +64,7 @@ def feature_added(self):
new_feature = self.kaava_layer.getFeature(new_feature_id)
if new_feature.isValid():
feature_id_value = new_feature["id"]
QgsExpressionContextUtils.setProjectVariable(QgsProject.instance(), "active_plan_id", feature_id_value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tämän voisi siirtää update_selected_plan() metodiin. Samalla metodin voisi ehkä nimetä selkeämmin esim set_active_plan() ja se asettaisi filtterit ja tuon muuttujan.

@@ -92,10 +93,12 @@ def load_land_use_plan(self):
return

plan = LandUsePlan(selected_plan_id)
QgsExpressionContextUtils.setProjectVariable(QgsProject.instance(), "active_plan_id", selected_plan_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jos update_selected_plan() hoitaa tuon muuttujan asettamisen, niin tämän voi poistaa.

@Mtk112 Mtk112 force-pushed the 61-lisaa-plugin-asetuksiin-lambda-kutsujen-osoite branch 2 times, most recently from b8a109a to 5259a6a Compare November 15, 2024 08:05
Added settings button, where user can change the lambda-address.
Store plan's id to a ProjectVariable when creating new plan or opening existing plan.
Clear active_plan_id in clear_all_filters()
@LKajan LKajan force-pushed the 61-lisaa-plugin-asetuksiin-lambda-kutsujen-osoite branch from 5259a6a to 4cf2df5 Compare November 18, 2024 09:29
@LKajan LKajan merged commit 9e708d6 into main Nov 18, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lisää plugin asetuksiin lamda-kutusujen osoite
2 participants